'use strict';

var passport = module.exports;
/**
 * seperate the list of passport modules for re-use
 */
passport.getStrategies = function(lang)
{
	return [
		{
			name: 'Facebook',
			value: 'facebook',
			module: 'passport-facebook' ,
			ver: '~1.0.2',
			checked: ((lang==='en') ? true: false)
		},
		{
			name: 'Twitter' ,
			value: 'twitter' ,
			module: 'passport-twitter',
			ver:'~1.0.2' ,
			checked:  ((lang==='en') ? true: false)
		},
		{
			name: 'Google' ,
			value: 'google' ,
			module: 'passport-google-oauth',
			ver: '~0.1.5' ,
			checked:  ((lang==='en') ? true: false)
		},
		{
			name: 'Github' ,
			value: 'github' ,
			module: 'passport-github' ,
			ver: '~0.1.5' ,
			checked:  ((lang==='en') ? true: false)
		},
		{
			name: 'LinkedIn' ,
			value: 'linkedin' ,
			module: 'passport-linkedin',
			ver: '~0.1.3' ,
			checked:  ((lang==='en') ? true: false)
		},
		{
			name:  ((lang==='cn') ? '微信' : 'WeChat') ,
			value: 'wechat' ,
			module: 'passport-wechat' ,
			ver: '~0.1.3' ,
			checked:  ((lang==='cn') ? true: false)
		},
		{
			name: 'QQ' ,
			value: 'qq' ,
			module: 'passport-qq' ,
			ver: '0.0.3' ,
			checked:  ((lang==='cn') ? true: false)
		},
		{
			name:  ((lang==='cn') ? '微博' : 'Weibo') ,
			value: 'weibo' ,
			module: 'passport-weibo' ,
			ver: '~0.1.2' ,
			checked:  ((lang==='cn') ? true: false)
		}
	];
};

passport.getStrategiesConfig = function(name)
{
	var strategies = {
		facebook: '{\nclientID: process.env.FACEBOOK_ID || \'APP_ID\',\nclientSecret: process.env.FACEBOOK_SECRET || \'APP_SECRET\',\ncallbackURL: \'/auth/callback/facebook\'\n}',
		github: '{\nclientID: process.env.GITHUB_ID || \'APP_ID\',\nclientSecret: process.env.GITHUB_SECRET || \'APP_SECRET\',\ncallbackURL: \'/auth/callback/github\'\n}',
		google: '{\nclientID: process.env.GOOGLE_ID || \'APP_ID\',\nclientSecret: process.env.GOOGLE_SECRET || \'APP_SECRET\',\ncallbackURL: \'/auth/callback/google\'\n}',
		linkedin: '{\nclientID: process.env.LINKEDIN_ID || \'APP_ID\',\nclientSecret: process.env.LINKEDIN_SECRET || \'APP_SECRET\',\ncallbackURL: \'/auth/callback/linkedin\'\n}',
		qq: '{\nclientId: process.env.QQ_ID || \'APP_ID\',\nclientSecret: process.env.QQ_SECRET || \'APP_SECRET\',\ncallbackUrl: \'/auth/callback/qq\'\n}',
		twitter: '{\nclientId: process.env.TWITTER_ID || \'APP_ID\',\nclientSecret: process.env.TWITTER_SECRET || \'APP_SECRET\',callbackUrl: \'/auth/callback/twitter\'\n}',
		wechat: '{\nappId: process.env.WECHAT_ID || \'APP_ID\',\nappSecret: process.env.WECHAT_SECRET || \'APP_SECRET\',\ncallbackURL: \'/auth/callback/wechat\',\nscope: \'snsapi_base\',\nstate: true\n}',
		weibo: '{\nclientId: process.env.WEIBO_ID || \'APP_ID\'\n,clientSecret: process.env.WEIBO_SECRET || \'APP_SECRET\'\n,callbackUrl: \'/auth/callback/weibo\'\n}'
	};
	return strategies[name];
};
